<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设计停车系统</title>
</head>

<body>
  <script>
    function fn(big, medium, small) {
      // 把停车位的数量记录好
      this.carsNum = [big, medium, small];
    }
      ParkingSystem.prototype.addCar = function (carType) {
        // carType:大1中2小3与数组的对应关系
      if(this.carsNum[carType-1] === 0){
          // 没有停车位了，就返回false
          return false;
      }
      // 还有，就占一个，并返回true
      this.carsNum[carType-1]--;
      return true;
    }
    console.log()
  </script>
</body>

</html>